import java.util.*;
public class Tao2
{
	public static void main (String[] args)
	{
		Random in = new Random();
		Scanner out = new Scanner(System.in);
		String num = "y";
		int num5 =0,num6=1;
		while (num5 != num6)
		{
			System.out.println("how many do you need?");
			int num1= out.nextInt();
			int sum = 0;
			for (int i = 0;i < num1;i++)
			{
				int num2 = in.nextInt(6) + 6;
				int num3 = num2%6;
				switch (num3)
				{
					case 0:
						int a,b;
						a = in.nextInt(21) - 10;
						b = in.nextInt(21) - 10;

						System.out.println (a + "+"+ b+ "=" +"?");
						int d = out.nextInt();
						if (d == a + b)
						{System.out.println ("true");
							        sum = sum + 1;
						}
						else 
							System.out.println ("wrong");
						break;
			                case 1:
				                int e,f,g;
				            e = in.nextInt(21) - 10;
					    f = in.nextInt(21) - 10;
					   System.out.println ( e + "-"+f+"="+"?");
				        g = out.nextInt();
						if (g == e - f )
							{System.out.println ("true");
						        sum = sum + 1;
								}
						else
						System.out.println ("wrong");
						break;
				        case 2:
					int h,v,j;
						h = in.nextInt(21) - 10;
						v = in.nextInt(21) - 10;
						System.out.println (h + "*"+v+"="+"?");
					       j = out.nextInt();
						 if (j == h*v)
					 {System.out.println("true");
					      sum = sum +1;
							 }
						 else
					 System.out.println("wrong");
					 break;
					case 3:
						 int k,l;
						 k = in.nextInt(10)+1;
							 l = in.nextInt(10) +1;
							 System.out.println (k +"/"+l+"="+"?");
					// m = out.nextInt();
							 String m = out.nextLine();
							 String mm = new String(k+"/"+l);
							 int left = 0;
							 int right = mm.length()-1;
							 while(m.charAt(left) == mm.charAt(left) && left < right)
							 {
								 left++;
							 }
							 if(left==right)
								 {System.out.println("true");
										         sum = sum +1;
									 }
								 else
								 { System.out.println("wrong");
									 System.out.println("it's:"+mm);
								 }
							 break;
					case 4:
						 int c,n,o,p;
						c = in.nextInt(21) - 10;
						 n = in.nextInt(21) - 10;
						 o = in.nextInt(21) - 10;
					System.out.println (c +"+"+n+"*"+o+"="+"?");
					p = out.nextInt();
					if(p == c+n*o)
					{System.out.println("true");
					 sum = sum +1;
						 }
					 else
						System.out.println("wrong");
					 break;
					case 5:
									 int q,r,s,ss;
									 q = in.nextInt(10) +1;
									 r = in.nextInt(10) +1;
									 s = in.nextInt(10) +1;
									 ss = in.nextInt(10)+1;
									 System.out.println (q+"/"+r+"+"+s+"/"+ss+"="+"?");
									String t = out.nextLine();
									int qss = q*ss+r*s;
									int rss = r*ss;
									String qr = new String(qss+"/"+rss);
									int leftt = 0;
									int rightt = qr.length()-1;
							 while(qr.charAt(leftt) == t.charAt(leftt) && leftt < rightt)
							 {
								 leftt++;
							 }
							 if (leftt==rightt)
							 {
								 System.out.println("true");
								 sum = sum + 1;
							 }
							 else
								 System.out.println("wrong");
					 break;
				}
			}
			System.out.println ("You have correct:"+sum);
			
			
			System.out.println ("Do you want to try again ?(y=0/n=1)");
			num5= out.nextInt();


		}
	}
}

